//
//  hyWeiTalkController.m
//  anjuke
//
//  Created by jim Yao on 16/1/1.
//  Copyright © 2016年 anjuke. All rights reserved.
//

#import "hyWeiTalkController.h"

@interface hyWeiTalkController ()
@property (nonatomic,weak)UIButton * selected;
@property (nonatomic,weak)UIView * bgView;
@property (nonatomic,assign)BOOL isBtnClick;



@end

@implementation hyWeiTalkController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setPlusBtn];

    
}

- (void)setPlusBtn{
    self.view.backgroundColor = [UIColor whiteColor];
    
    UIButton *plusBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 50,50)];
    
    [plusBtn setImage:[UIImage imageNamed:@"xproject_chatlist_plus@2x.png.base.universal.regular.off.horizontal.normal.active.onepartscale.onepart.55066.000.00."] forState:UIControlStateNormal];
    
    self.navigationItem.rightBarButtonItem= [[UIBarButtonItem alloc] initWithCustomView:plusBtn];
    
    [plusBtn addTarget:self action:@selector(showChatList) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)showChatList{
    CGFloat width = self.view.bounds.size.width;
    CGFloat height = self.view.bounds.size.height;
    
    UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, height)];
    backgroundView.backgroundColor = [UIColor colorWithRed:200/255.0 green:200/255.0 blue:200/255.0 alpha:1];
    [self.view addSubview:backgroundView];
    self.bgView = backgroundView;
    
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeBackground)];
    tap.numberOfTapsRequired=1;
    [backgroundView addGestureRecognizer:tap];
    
}
- (void)removeBackground{
    [self.bgView removeFromSuperview];
    
}
@end
